﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;
using System.Security.Cryptography;
using System.Text;

namespace ITProject.WebUI.Infrastructure
{
    public class Helpers
    {
        public static string PasswordHashProvider(string password, string salt)
        {
            var sha512 = new SHA512Managed();
            byte[] plainPasswordbytes = Encoding.UTF8.GetBytes(string.Concat(password, salt));
            var EncryptedBytes = sha512.ComputeHash(plainPasswordbytes);
            StringBuilder s = new StringBuilder();
            foreach (byte b in EncryptedBytes)
                s.Append(((char)b).ToString());
            return s.ToString();
        }

    }
}